<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:pe="http://primefaces.org/ui/extensions">
    <f:loadBundle  basename="resources.caption" var="caption"/>
    <!--<f:view locale="#{localeBean.locale}">-->
    <h:head>
        <title>Koperasi v.1</title>
      <!--  <link href="./resources/css/default.css" rel="stylesheet" type="text/css" /> -->
       <h:outputStylesheet name="default.css" library="css" />
       <!--<h:outputStylesheet name="#{request.contextPath}/themes/#{usersConfigBean.usersConfig.themes}/skin.css" library="css" />-->
       <h:outputScript name="autoNumeric.js" library="js" />
       <script type="text/javascript" >
           $(function(){
               $("input.money").autoNumeric({aSep:".",aDec:",",mDec:2,mNum:15});
           });   
       </script>
    </h:head>
    <h:body   style="font-size: 10px;border-spacing: 0;margin: 0;">
        <f:view>
                  <!--<h:form id="frmMain">  -->
            <style type="text/css">
.footer .ui-layout-unit-content {
   background-color: red !important;
}

.content .ui-layout-container{
overflow: auto !important;


}

#ajaxStatusPanel {
	position: absolute;
	top: 0;
	left:0;
	color: white;
	background-color: transparancy;
	padding: 0px 0px;
	font: 12px;
	font-weight: bold;
	z-index:3000000;
	width:100%;
	height:100%;
	opacity:0.9;
	filter:alpha(opacity=90);
}


</style>
                  <p:growl id="growl" showDetail="true" autoUpdate="true" sticky="true" life="1000"/> 
              <!--    <p:dialog header="Effects" widgetVar="growl" showEffect="explode" hideEffect="explode" height="100">  
                    <h:outputText value="This dialog has nice effects." />  
                </p:dialog> -->
           
           <p:layout fullPage="true">
               <p:layoutUnit id="layoutNorth" position="north" size="40" >  
                    <p:ajaxStatus style="width:16px;height:16px;" id="ajaxStatusPanel">  
                        <f:facet name="start">  
                            <h:graphicImage value="resources/images/ajax-loader.gif" />  
                        </f:facet>  

                        <f:facet name="complete">  
                            <h:outputText value="" />  
                        </f:facet>  
                     </p:ajaxStatus> 
                   <!--<input type="text" id="txt_count" name="txt_count" value="#{menuBean.tabActiveIndex}"/> -->
                <p:toolbar >  
                    <p:toolbarGroup align="right" >  
                   <h:form>
                    <!--<p:menuButton value="Settings">                          
                        <p:menuitem value="Options" actionListener="#{menuBean.addTab}" update="tabViewMenu">
                             <f:param name="title" value="Options"></f:param>
                                <f:param name="id" value="options"></f:param>
                                <f:param name="url" value="system/options.xhtml"></f:param>
                        </p:menuitem>  
                        
                    </p:menuButton>  -->
                    
                    
                    <p:commandButton id="btnUserLogin" value="#{loginBean.selectedUser.fullName}" type="button"/>
                    <p:menu position="dynamic" trigger="btnUserLogin" my="right top" at="right bottom">
                        <!--<p:menuitem value="Themes..." actionListener="#{menuBean.addTab}" update=":tabViewMenu">
                             <f:param name="title" value="Themes"></f:param>
                                <f:param name="id" value="1000"></f:param>
                                <f:param name="url" value="system/themes.xhtml"></f:param>
                        </p:menuitem>  -->
                        <p:menuitem value="Options..." actionListener="#{menuBean.addTab}" update=":tabViewMenu">
                             <f:param name="title" value="Option"></f:param>
                                <f:param name="id" value="1001"></f:param>
                                <f:param name="url" value="system/options.xhtml"></f:param>
                        </p:menuitem>
                        <p:menuitem value="Dashboards..." actionListener="#{menuBean.addTab}" update=":tabViewMenu">
                             <f:param name="title" value="Options"></f:param>
                                <f:param name="id" value="1002"></f:param>
                                <f:param name="url" value="system/options.xhtml"></f:param>
                        </p:menuitem>  
                        <p:menuitem value="Change Password" actionListener="#{menuBean.addTab}" update=":tabViewMenu">
                             <f:param name="title" value="Options"></f:param>
                                <f:param name="id" value="1003"></f:param>
                                <f:param name="url" value="system/options.xhtml"></f:param>
                        </p:menuitem>  
                        <p:separator/>
                        <p:menuitem action="#{loginBean.logout()}" value="Sign Out">
                             <f:param name="title" value="Options"></f:param>
                                <f:param name="id" value="options"></f:param>
                                <f:param name="url" value="system/options.xhtml"></f:param>
                        </p:menuitem>  
                    </p:menu>
                        
                       </h:form>
                </p:toolbarGroup>  
                <p:toolbarGroup align="right" >  
                   <h:form>
                       <p:commandButton actionListener="#{menuBean.addTab}"  update=":tabViewMenu" value="Dashboards">
                            
                             <f:param name="title" value="Dasboards"></f:param>
                                <f:param name="id" value="dashboard"></f:param>
                                <f:param name="url" value="system/dashboards.xhtml"></f:param>
                        </p:commandButton>
                        
                    
                       </h:form>
                </p:toolbarGroup>      
            </p:toolbar>  

            </p:layoutUnit>  

               <p:layoutUnit id="layoutSouth" position="south" size="50">  
                   <h:outputText value="IP Address : " /><h:outputText value="#{loginBean.ipAddress}"/>&nbsp;&nbsp;
                   <h:outputText value="Themes : " /><h:outputText value="#{usersConfigBean.usersConfig.themes}"/>
                    
                
            </p:layoutUnit>  
<p:layoutUnit position="west" size="200" header="Left Menu" resizable="true" collapsible="true">  
   <!-- <p:menu model="#{menuBean.model}"></p:menu> -->
    
                
    <p:accordionPanel id="accordionMenu" value="#{menuBean.listModule}" var="modul" >
                        <p:tab title="#{modul.modulName}" >
                            <h:form>
                                <p:tree style="margin-left: -25px;width: 200px;border: 0" dynamic="true" value="#{modul.rootNode}" var="node"  selectionMode="single">
                                    <p:ajax event="select" update=":tabViewMenu"  listener="#{menuBean.onNodeSelect}" ></p:ajax>
                                    <p:treeNode  expandedIcon="ui-icon-folder-open"  collapsedIcon="ui-icon-folder-collapsed" >#{node.menuName}</p:treeNode>
                                </p:tree>
                            </h:form>
                           <!-- <ui:repeat value="#{modul.menuList}" var ="itemNode" >
                                <h:form>
                                <p:commandLink  actionListener="#{menuBean.addTab}" update="tabViewMenu"> #{itemNode.title}
                                
        
                                <f:param name="val" value="2"></f:param>
                                <f:param name="title" value="#{itemNode.title}"></f:param>
                                <f:param name="id" value="#{itemNode.id}"></f:param>
                                <f:param name="url" value="#{itemNode.url}"></f:param>
                                </p:commandLink> 
                                    </h:form>
                                <br/>
                            </ui:repeat> -->
                        </p:tab>                       
                    </p:accordionPanel>
                    
              
            </p:layoutUnit>  
               <p:layoutUnit id="layoutCenter" position="center" >                 
    <!--<p:commandLink   
        actionListener="#{menuBean.increment}" update=":frmMain:txt_count :frmMain:tabViewMenu"> #{caption.btnSave} Counte2
        <f:param name="val" value="2"></f:param>        
    </p:commandLink> -->
     
    <p:panel  id="mainPanel"  style="border:0;margin-left: -13px;margin-top: -10px" >
          
    
        <p:tabView  style="border: 0" id="tabViewMenu" rendered="true" cache="true" activeIndex="#{menuBean.tabActiveIndex}">
       <p:ajax event="tabClose" listener="#{menuBean.onClose}" /> 
        
        <c:forEach items="#{menuBean.showTabs}" var="menu" varStatus="loop">
            <c:choose>
             <c:when test="#{menu.url!=null}">
                                  
            
            <p:tab titleStyle="border:1" id="tab#{loop.count}" title="#{menu.menuName}" closable="true" >  
               <ui:include src="#{menu.url}" ></ui:include> 
               
                       <!--<p:scrollPanel style="width:100%;height:430px">
                           <h:panelGroup rendered="true" style="width:100%;height:430px">
                           <c:choose>
                               <c:when test="#{menu.url!=null}">
                                   <ui:insert name="myView">
                                   <ui:include src="#{menu.url}" ></ui:include>
                                   </ui:insert>
                               </c:when>
                               <c:otherwise>
                                   <ui:include src="master/buslic.xhtml" ></ui:include>    
                                </c:otherwise>
                           </c:choose> 
                           
                       </h:panelGroup>
                      </p:scrollPanel> -->
                        </p:tab>     
                       </c:when>
            </c:choose> 
        </c:forEach>
                      </p:tabView> 
       </p:panel>
                   </p:layoutUnit>  
               </p:layout>

            </f:view>
    </h:body>
<!--        </f:view>-->
</html>

